<?php
$this->pageTitle="Báo cáo Doanh thu";
?>
<?php if(!empty($data)):
$i=1;
?>
<style>
table{
	width: 100%;
	border-color: #ddd;
	border-collapse: collapse;
}
table tr th{
	background:#ccc;
}
table tr th, table tr td{
	padding: 5px;
}
</style>
<div class="wrr-x-grid">
<h1>Báo cáo doanh thu từ ngày <?php echo date('d/m/Y',strtotime($this->time['from'])); ?> đến <?php echo date('d/m/Y',strtotime($this->time['to']));?></h1>
<table class="items itable" border="1">
<tr>
	<th>STT</th>
	<th>Ngày gửi</th>
	<th>Khách hàng</th>
	<th>Người nhận</th>
	<th>Hãng CPN</th>
	<th>Air Bill</th>
	<th>Trọng lượng</th>
	<th>Tiền cước</th>
</tr>
<?php 
$totalFee = 0;
foreach ($data as $key => $value):
$totalFee +=$value['fee'];
?>
<tr>
	<td><?php echo $i;?></td>
	<td><?php echo $value['date'];?></td>
	<td><?php echo $value['customer_name'];?></td>
	<td><?php echo $value['receiver'];?></td>
	<td><?php echo $value['type'];?></td>
	<td><?php echo $value['air_bill'];?></td>
	<td><?php echo $value['product_weight'];?></td>
	<td><?php echo Common::priceFormat($value['fee']);?></td>
</tr>
<?php 
$i++;
endforeach;?>
</table>
<div style="text-align: right; padding: 10px;">
Tổng cước: <b><?php echo Common::priceFormat($totalFee);?></b>
</div>
</div>
<?php elseif($this->time!=''):?>
<div>Không có Bill nào.</div>
<?php endif;?>
